package com.hee.erp.modules.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hee.erp.enums.AuditStatusEnum;
import com.hee.erp.vo.leave.AuditFlowNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 
 * </p>
 *
 * @author weizehong
 * @since 2022-05-18
 */
@Getter
@Setter
@TableName("t_audit_leave")
@ApiModel(value = "AuditLeave对象", description = "")
public class AuditLeave implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("id")
    private String id;

    @NotNull(message = "申请时间不能为空")
    @TableField("begin_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime beginTime;

    @TableField("end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime endTime;

    @ApiModelProperty("请假类型")
    @TableField("leave_type_id")
    @NotBlank(message = "请假类型不能为空")
    private String leaveTypeId;

    @TableField(exist = false)
    private String leaveTypeName;

    /**
     * 当前审核人id
     */
    @TableField(exist = false)
    private String auditingAuditorId;

    /**
     * 当前审核人姓名
     */
    @TableField(exist = false)
    private String auditingAuditorName;

    @ApiModelProperty("请假原因")
    @TableField("leave_reason")
    @NotNull(message = "请假内容不能为空")
    private String leaveReason;

    @ApiModelProperty("批准时间")
    @TableField("approve_time")
    private LocalDateTime approveTime;

    @ApiModelProperty("请假时长")
    @TableField("leave_hours")
    @NotNull(message = "请假时长不能为空")
    @Min(value = 0, message = "请假时长不能小于0")
    private BigDecimal leaveHours;

    @ApiModelProperty("审核状态")
    @TableField(exist = false)
    private AuditStatusEnum auditStatus;

    @TableField(exist = false)
    private String auditStatusName;

    @TableField(value = "del_flag",fill = FieldFill.INSERT)
    private Boolean delFlag;

    @TableField(value = "create_user",fill = FieldFill.INSERT)
    private String createUser;

    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "modify_user",fill = FieldFill.INSERT_UPDATE)
    private String modifyUser;

    @TableField(value = "modify_time",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime modifyTime;


    @TableField(exist = false)
    private String createUserName;

    @TableField(exist = false)
    private AuditFlowNode auditFlowNode;

    @TableField(exist = false)
    private String auditRemark;


}
